<template>
  <div>
    <ul>
      <li v-for="value in messageList" :key="value.id">
        <!-- 字符串写法 -->
        <!-- <router-link :to="`/home/message/detail/${value.id}/${value.title}`">{{
          value.title
        }}</router-link
        >&nbsp;&nbsp; -->

        <!-- 对象写法 -->
        <router-link
          :to="{
            name: 'xiangqing',
            query: {
              id: value.id,
              title: value.title,
            },
          }"
          >{{ value.title }}</router-link
        >&nbsp;&nbsp;
      </li>
    </ul>
    <hr />
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "Message",
  data() {
    return {
      messageList: [
        { id: "001", title: "message001" },
        { id: "002", title: "message002" },
        { id: "003", title: "message003" },
      ],
    };
  },
};
</script>
